// Windows/System.cpp

#include "StdAfx.h"

#include "System.h"

#include <algorithm>

namespace Common {
namespace System {

UINT32 GetNumberOfProcessors()
{
  SYSTEM_INFO systemInfo;
  GetSystemInfo(&systemInfo);
  return (UINT32)systemInfo.dwNumberOfProcessors;
}

UINT64 GetRamSize()
{
  MEMORYSTATUSEX stat;
  stat.dwLength = sizeof(stat);
  if (::GlobalMemoryStatusEx(&stat))
    return min(stat.ullTotalVirtual, stat.ullTotalPhys);
  return 0;
}

}}
